//
// Decompiled by Jadx - 343ms
//
package gc;

import android.app.Activity;
import android.text.TextUtils;
import androidx.appcompat.app.t;
import dq.b;
import fi.c;
import fi.w;
import fi.y;
import gc.ac;
import gc.bv;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashMap;
import me.plusne.common.Http.Vote;
import me.plusne.common.Json.VoteSubmit;
import r.f;
import s.ai;
import s.aj;
import s.ao;

public final class bt implements bv.g, ac.b, w.c, w.b {
    public final int a;
    public final Object b;
    public final Object c;
    public final Object d;

    public bt(Object obj, Serializable serializable, int i, Object obj2) {
        this.b = obj;
        this.c = serializable;
        this.a = i;
        this.d = obj2;
    }

    public bt(HashMap hashMap, int[] iArr, int i, String str) {
        this.c = hashMap;
        this.d = iArr;
        this.a = i;
        this.b = str;
    }

    public bt(ao aoVar, Activity activity, VoteSubmit voteSubmit, int i) {
        this.b = aoVar;
        this.c = activity;
        this.d = voteSubmit;
        this.a = i;
    }

    public final void e(Method method, Object[] objArr) {
        HashMap hashMap = (HashMap) this.c;
        int[] iArr = (int[]) this.d;
        String str = (String) this.b;
        String str2 = cf.cp;
        if (method.getName().equals("onError")) {
            ac.dc("cn.soulapp.android.component.home.api.user.user.IUserApi", "NEW_APIA", "getUserHomeList", cf.cq, new Object[]{hashMap});
        }
        if (method.getName().equals("onNext")) {
            int i = iArr[0] + 1;
            iArr[0] = i;
            int i2 = this.a;
            if (i >= i2) {
                f i3 = f.i();
                i3.n();
                i3.l("[" + str + "]执行完成 " + i2 + " 次");
                return;
            }
            f i4 = f.i();
            i4.k();
            i4.l("[" + str + "]已执行 " + iArr[0] + "/" + i2);
            ac.dc("cn.soulapp.android.component.home.api.user.user.IUserApi", "NEW_APIA", "getUserHomeList", cf.cq, new Object[]{hashMap});
        }
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        ao aoVar = (ao) this.b;
        Activity activity = (Activity) this.c;
        VoteSubmit voteSubmit = (VoteSubmit) this.d;
        int i = this.a;
        aoVar.getClass();
        if (!TextUtils.isEmpty(str)) {
            y.e(activity);
            String token = aoVar.a.getToken();
            int id = voteSubmit.getId();
            t.c().j(((Vote) b.b(Vote.class)).adminReply(token, id, str, 0).subscribeWith(new ai(aoVar, activity, voteSubmit, str, i, wVar)));
        }
    }

    public final void i(w wVar, c.a aVar, int i, int i2) {
        ao aoVar = (ao) this.b;
        VoteSubmit voteSubmit = (VoteSubmit) this.c;
        int i3 = this.a;
        w wVar2 = (w) this.d;
        y.e(aoVar.e);
        if (voteSubmit.getRole() == 2) {
            i2 = 2;
        }
        t.c().j(((Vote) b.b(Vote.class)).updateStatus(aoVar.a.getToken(), voteSubmit.getId(), i2).subscribeWith(new aj(aoVar, aoVar.e, i3, i2, wVar, wVar2)));
    }
}
